package com.ehotting.edsta.diagnosisPredict.feign.factory;

import com.ehotting.eaf.core.web.domain.diagnosisPredict.Response;
import com.ehotting.edsta.diagnosisPredict.domain.dto.TrainingModelDataDto;
import com.ehotting.edsta.diagnosisPredict.feign.TrainingFeignService;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpResponse;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 训练模型表的降级处理
 * 
 * @author edsta
 */
@Slf4j
@Component
public class TrainingFallbackFactory implements FallbackFactory<TrainingFeignService> {

    @Override
    public TrainingFeignService create(Throwable throwable)
    {
        log.error("训练模型表调用失败:{}", throwable.getMessage());
        return new TrainingFeignService() {
            @Override
            public Response<TrainingModelDataDto> findByProjectId(Long projectId) {
                return null;
            }

            @Override
            public feign.Response modelDataSdk(Long id) {
                return null;
            }

            @Override
            public Response<TrainingModelDataDto> findByTrainingTask(Long taskId) {
                return null;
            }
        };
    }
}
